//
//  QSProblemStateCell.m
//  DigitalEconomy_iOS
//
//  Created by Ding on 2020/3/26.
//  Copyright © 2020 DingC. All rights reserved.
//

#import "QSProblemStateCell.h"

@implementation QSProblemStateCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self configSubView];
}

- (void)configSubView{
    self.backgroundColor = [UIColor clearColor];
    self.contentView.layer.cornerRadius = 8;
    self.contentView.layer.masksToBounds = YES;
    self.contentView.backgroundColor = [UIColor QSColorWhiteFFFFFF];
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.mas_leading).offset(kRealValue(10));
        make.trailing.equalTo(self.mas_trailing).offset(kRealValue(-10));
        make.top.equalTo(self.mas_top).offset(kRealValue(10));
        make.bottom.equalTo(self.mas_bottom).offset(kRealValue(0));
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void)setModel:(QSProblemDetailModel *)model{
    _model = model;
    if (model.state.integerValue == 1) {
        _stateImageView.image = [UIImage imageNamed:@"ic_problem_waiting"];
        _stateLabel.text = @"待处理";
    }else if (model.state.integerValue == 2){
        _stateImageView.image = [UIImage imageNamed:@"ic_problem_dealing"];
        _stateLabel.text = @"处理中";

    }else if (model.state.integerValue == 3){
        _stateImageView.image = [UIImage imageNamed:@"ic_problem_unaccept"];
        _stateLabel.text = @"不处理";
    }else{
        _stateImageView.image = [UIImage imageNamed:@"ic_problem_finish"];
        _stateLabel.text = @"已办结";
    }
}
@end
